//
//  OrderViewController.m
//  ChhOrderApp
//
//  Created by chh on 16/8/11.
//  Copyright © 2016年 chh. All rights reserved.
//

#import "OrderViewController.h"
#import "MenuCell.h"

@interface OrderViewController ()<UITableViewDelegate,UITableViewDataSource>

@property (weak, nonatomic) IBOutlet UITableView *menuTabView;

@end

@implementation OrderViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"点餐区";
    [self loadViews];
    // Do any additional setup after loading the view from its nib.
}

- (void)loadViews{
    
    [self.menuTabView registerNib:[UINib nibWithNibName:@"MenuCell" bundle:nil] forCellReuseIdentifier:[MenuCell menuCell]];
    self.menuTabView.delegate = self;
    self.menuTabView.dataSource = self;
    
}

#pragma mark
#pragma mark -- UITableViewDataSource

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 10;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    MenuCell *cell = [tableView dequeueReusableCellWithIdentifier:[MenuCell menuCell]];

    [cell.orderBtn addTarget:self action:@selector(orderAction:) forControlEvents:UIControlEventTouchUpInside];
    
    return cell;
}

#pragma mark
#pragma mark -- UITableViewDelegate

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 80;
}

#pragma mark
#pragma mark -- orderAction

- (void)orderAction:(UIButton *)sender{
    [UpViewUtil showViewWithMessage:@"请仔细阅读下单内容，是否确定下单？本店概不退换！" AndViewController:self sure:^{
        
    } cancle:^{
        
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
